import java.util.Arrays;

public class TestMain {
    public static void selectionSort(int[] array) {
        int len = array.length;
        for(int i = 0; i < len ; i ++) {
            int tmp = i;
            for(int j = i + 1; j < len ; j++) {
                if(array[j] < array[tmp]) {
                    tmp = j;
                }
            }
        }
    }
    public static void inserSort(int[] array) {
        int len = array.length;
        for(int i = 1; i < len ; i++) {
            int tmp = array[i];
            int j = i-1;
            for(; j >= 0; j--) {
                if (tmp < array[j]) {
                    array[j + 1] = array[j];
                } else {
                    break;
                }
            }
            array[j + 1] = tmp;
        }
    }
    public static void main(String[] args) {
        int[] array = {4,6,4,2,9,0,12,45,32};
        FourSort fourSort = new FourSort();
        fourSort.shellSort(array);
        //fourSort.straightInsertion(array);
        //inserSort(array);
        for(int i = 0; i < array.length; i ++) {
            System.out.print(array[i] + " ");
        }
    }
}
